package com.cloud.nacos.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class OrderNacosController {

    @Resource
    private RestTemplate template;

    private static String URL_STRING = "http://nacos-payment-provider";

    @GetMapping("/order/nacos/{id}")
    public String PaymentInfo(@PathVariable("id")Integer id){
        System.out.println(URL_STRING+"/payment/nacos/"+id);
        return template.getForObject(URL_STRING+"/payment/nacos/"+id,String.class);
    }


}
